package com.example.audio_test.ui

import android.net.Uri
import com.alibaba.android.arouter.facade.annotation.Route
import com.dl7.player.media.IjkPlayerView
import com.example.audio_test.R
import com.kun.base.ui.AbsBaseActivity
import kotlinx.android.synthetic.main.activity_ijk_palyer.*

/**
 *
 *
 * @author : Kun
 * @date : 2021/8/3
 * @time : 16:46
 */
@Route(path = "/recordTest/IjkPlayerActivity")
class IjkPlayerActivity:AbsBaseActivity() {
    override fun getLayoutId(): Int {
        return R.layout.activity_ijk_palyer
    }

    override fun initViewModel() {
    }

    override fun initView() {
        player_view.init().setVideoPath(Uri.parse("http://www.520mylove.com/1.mp4") )
            .setMediaQuality(IjkPlayerView.MEDIA_QUALITY_HIGH)
            .enableDanmaku()
            .start()
    }

    override fun onResume() {
        super.onResume()
        player_view.onResume()
    }

    override fun onPause() {
        super.onPause()
        player_view.onResume()
    }

    override fun onDestroy() {
        super.onDestroy()
        player_view.onDestroy()
    }
}